﻿using Domain.Entitys;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;

namespace EFCore.Configers
{
    public class RolesConfigers : IEntityTypeConfiguration<Roles>
    {
        /// <summary>
        /// 角色表
        /// </summary>
        /// <param name="builder"></param>
        public void Configure(EntityTypeBuilder<Roles> builder)
        {
            builder.ToTable(nameof(Roles));
            builder.HasKey(r => r.RolesID);
            builder.Property(r => r.RolesName).IsRequired(false).HasMaxLength(50);
            builder.Property(r => r.RolesInstruction).IsRequired(false).HasMaxLength(200);
            builder.Property(r => r.RolesIf).IsRequired();
        }
    }
}